<?php
   $conn = @mysql_connect("localhost", "root", "") or die(mysql_error());
    mysql_select_db("mydb") or die(mysql_error());
	
function get_paper_title($paper_id)
{
    $get_title=(mysql_query("select paper_title From paper Where paper_id = '$paper_id'")) or die(mysql_error());
    $row = mysql_fetch_assoc($get_title);
    $title = $row['paper_title'];
    return $title;
}
function get_conference_name($conference_id)
{
    $get_name=(mysql_query("select long_name From conference Where conference_id = '$conference_id'")) or die(mysql_error());
    $row = mysql_fetch_assoc($get_name);
    $name = $row['long_name'];
    return $name;
}
function get_latest_version($paper_id)
{
         $Latest_Version = mysql_query ("SELECT version_id
                FROM version WHERE paper_id = '$paper_id' ORDER BY version_id DESC");
				$row = mysql_fetch_assoc($Latest_Version);
				$version = $row['version_id'];
				return $version;
			

}
function get_role ($member_id , $conference_id)
{
    $get_role = (mysql_query ("Select role From member_privileges m , privileges p Where m.privileges_id =p.privileges_id AND m.member_id = '$member_id' AND m.conference_id='$conference_id'"))or(mysql_error());
    $row = mysql_fetch_assoc($get_role);
    $role = $row['role'];
    return $role;
    
}
function get_first_name($member_id)
{
    $get_first_name = (mysql_query ("Select first_name From member Where member_id = '$member_id'"))or(mysql_error());
    $row = mysql_fetch_assoc($get_first_name);
    $first_name = $row['first_name'];
    return $first_name;
}
function get_last_name($member_id)
{
    $get_last_name = (mysql_query ("Select last_name From member Where member_id = '$member_id'"))or(mysql_error());
    $row = mysql_fetch_assoc($get_last_name);
    $last_name = $row['last_name'];
    return $last_name;
    
}


?>
